<!--
功能：个人信息展示,
作者：RanSheng,
邮箱：1534677527@qq.com",
时间：2021/6/6 23:39,
版本：v1.0,
修改记录：,
修改内容：,
修改人员：,
修改时间：,
-->
<template>
  <div class="app">
    <div class="box">
      <div class="page"
           v-for="u in userList"
           :key="u.id">
        <span class="sp1"><i :class="u.icon"></i></span>
        <span class="sp2">{{u.txt}}</span>
        <span class="sp3">{{u.name}}</span>
      </div>
    </div>
    <div class="box-no">
      <span>这不是我?</span>
    </div>
  </div>
</template>

<script>
import {mapState} from "vuex";

export default {
  name: "userOne",
  data() {
    return {
      userList: [],
    };
  },
  components: {},
  computed: {
    ...mapState(["user"])
  },
  mounted() {
    //  数据处理
    this.mates()
  },
  methods: {
    mates() {
      this.userList.push({
        id: 1,
        name: this.user.name,
        icon: 'el-icon-user',
        txt:'姓名'
      })
      this.userList.push({
        id: 2,
        name: this.user.account,
        icon: 'el-icon-user',
        txt:'学号'
      })
      this.userList.push({
        id: 3,
        name: this.user.professional,
        icon: 'el-icon-user',
        txt:'专业'
      })
      this.userList.push({
        id: 4,
        name: this.user.grade,
        icon: 'el-icon-user',
        txt:'班级'
      })
      this.userList.push({
        id: 5,
        name: this.user.card,
        icon: 'el-icon-user',
        txt:'身份证号'
      })
      this.userList.push({
        id: 6,
        name: this.user.phone,
        icon: 'el-icon-user',
        txt:'电话'
      })
      this.userList.push({
        id: 7,
        name: this.user.birth,
        icon: 'el-icon-user',
        txt:'生日'
      })
      this.userList.push({
        id: 8,
        name: this.user.score,
        icon: 'el-icon-user',
        txt:'分数'
      })
      this.userList.push({
        id: 9,
        name: this.user.beds.name,
        icon: 'el-icon-user',
        txt:'床位号'
      })
      this.userList.push({
        id: 10,
        name: this.user.room.name,
        icon: 'el-icon-user',
        txt:'房间号'
      })
      this.userList.push({
        id: 11,
        name: this.user.floor.name,
        icon: 'el-icon-user',
        txt:'楼层号'
      })
    }
  },
  watch: {},
  destroyed() {

  },
}
</script>

<style scoped>
.box-no{
  text-align: end;
  width: 100%;
  margin-bottom: 20px;
  font-weight: 700;
  color: #909399;
  cursor: pointer;
  transition: all .3s;
  letter-spacing: 4px;
}
.box-no:hover{
  color: #000000;
}
.box{
  width: 100%;
  min-height: 500px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-content: space-around;
  /*background-color: pink;*/
}
.page{
  width: 230px;
  height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.page span{
  color: #909399;
  font-size: 20px;
  margin: 5px 0;
}
.sp1 i{
  font-size: 40px;
}
.sp2{
}
.sp3{
  font-weight: 700;
  letter-spacing: 2px;
}
</style>
